package com.link.base.base.wechat.service;

import com.link.base.base.wechat.model.Menu;
import com.link.base.wechat.wxmenu.model.WxCommonButton;
import com.link.base.wechat.wxmenu.model.WxComplexButton;
import com.link.base.wechat.wxmenu.model.WxMenu;
import com.link.core.basic.service.BasicService;

import java.util.List;
import java.util.Map;

/**
 * 微信公众号自定义菜单service
 *
 * @author lujiang
 * @date 2019/02/26 10:00
 */
public interface MenuService extends BasicService<Menu> {

    /**
     * 修改自定义菜单
     * @param deletemenu
     * @param addmenu
     * @throws Exception
     */
    public void updateWxMenu(List<Menu> deletemenu,List<Menu> addmenu) throws Exception;

    /**
     * 创建微信自定义菜单
     *
     * @author lujiang
     * @date 2019/02/25 20:57
     * @param menulist 自定义菜单集合
     * @return
     */
    Map<String,Object> createWxMenu(List<Menu> menulist) throws Exception;

    /**
     * 生成菜单
     *
     * @author lujiang
     * @date 2019/02/25 20:57
     * @param complexButtonList 一级菜单
     * @param commonButtonList  子菜单
     * @return 菜单列表
     * @throws Exception
     */
    public WxMenu getMenu(List<WxComplexButton> complexButtonList,
                          List<WxCommonButton> commonButtonList) throws Exception;

    /**
     * 设置一级菜单
     * @author lujiang
     * @date 2019/02/25 20:57
     * @param list 菜单list
     * @return 一级菜单集合
     * @throws  Exception
     */
    public List<WxComplexButton> setComplexButton(List<Menu> list) throws Exception;

    /**
     * 设置二级菜单
     *
     * @author lujiang
     * @date 2019/02/25 20:57
     * @param lis 菜单list
     * @return 二级菜集合
     * @throws Exception
     */
    public List<WxCommonButton> setCommonButton(List<Menu> lis) throws Exception;

    /**
     * 清空自定义菜单
     *
     * @author lujiang
     * @date 2019/02/26 9:07
     * @param wx_id  微信公众号记录id
     * @return
     * @throws Exception
     */
    Map<String,Object> deleteWxMenu(Long wx_id) throws Exception;

    /**
     * 删除二级菜单
     *
     * @author lujiang
     * @date 2019/02/26 9:07
     * @param menulist 菜单集合
     * @return
     * @throws Exception
     */
    Map<String,Object> deleteSecondWxMenu(List<Menu> menulist) throws Exception;

    /**
     * 获取自定义菜单配置接口
     *
     * @author lujiang
     * @date 2019/02/26 9:27
     * @param wx_id 微信公众号记录id
     * @return
     * @throws Exception
     */
    Map<String,Object> queryWxMenu(String wx_id) throws Exception;

    /**
     * 删除菜单
     *
     * @author lujiang
     * @param ids 记录id集合
     * @return
     * @throws Exception
     */
    Map<String,Object> deleteMenu(Long[] ids) throws Exception;
}
